\(\int \frac {a+b \arctan (\frac {c}{x})}{x} \, dx\) [136]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 39 \[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=a \log (x)-\frac {1}{2} i b \operatorname {PolyLog}\left (2,-\frac {i c}{x}\right )+\frac {1}{2} i b \operatorname {PolyLog}\left (2,\frac {i c}{x}\right ) \]

[Out]

a*ln(x)-1/2*I*b*polylog(2,-I*c/x)+1/2*I*b*polylog(2,I*c/x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {4944, 4940, 2438} \[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=a \log (x)-\frac {1}{2} i b \operatorname {PolyLog}\left (2,-\frac {i c}{x}\right )+\frac {1}{2} i b \operatorname {PolyLog}\left (2,\frac {i c}{x}\right ) \]

[In]

Int[(a + b*ArcTan[c/x])/x,x]

[Out]

a*Log[x] - (I/2)*b*PolyLog[2, ((-I)*c)/x] + (I/2)*b*PolyLog[2, (I*c)/x]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4940

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))/(x_), x_Symbol] :> Simp[a*Log[x], x] + (Dist[I*(b/2), Int[Log[1 - I*c*x
]/x, x], x] - Dist[I*(b/2), Int[Log[1 + I*c*x]/x, x], x]) /; FreeQ[{a, b, c}, x]

Rule 4944

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/n, Subst[Int[(a + b*ArcTan[c*x])^p
/x, x], x, x^n], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {a+b \arctan (c x)}{x} \, dx,x,\frac {1}{x}\right ) \\ & = a \log (x)-\frac {1}{2} (i b) \text {Subst}\left (\int \frac {\log (1-i c x)}{x} \, dx,x,\frac {1}{x}\right )+\frac {1}{2} (i b) \text {Subst}\left (\int \frac {\log (1+i c x)}{x} \, dx,x,\frac {1}{x}\right ) \\ & = a \log (x)-\frac {1}{2} i b \operatorname {PolyLog}\left (2,-\frac {i c}{x}\right )+\frac {1}{2} i b \operatorname {PolyLog}\left (2,\frac {i c}{x}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.00 \[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=a \log (x)-\frac {1}{2} i b \operatorname {PolyLog}\left (2,-\frac {i c}{x}\right )+\frac {1}{2} i b \operatorname {PolyLog}\left (2,\frac {i c}{x}\right ) \]

[In]

Integrate[(a + b*ArcTan[c/x])/x,x]

[Out]

a*Log[x] - (I/2)*b*PolyLog[2, ((-I)*c)/x] + (I/2)*b*PolyLog[2, (I*c)/x]

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 86 vs. \(2 (31 ) = 62\).

Time = 1.33 (sec) , antiderivative size = 87, normalized size of antiderivative = 2.23

method result size
parts \(a \ln \left (x \right )+b \left (-\ln \left (\frac {c}{x}\right ) \arctan \left (\frac {c}{x}\right )-\frac {i \ln \left (\frac {c}{x}\right ) \ln \left (1+\frac {i c}{x}\right )}{2}+\frac {i \ln \left (\frac {c}{x}\right ) \ln \left (1-\frac {i c}{x}\right )}{2}-\frac {i \operatorname {dilog}\left (1+\frac {i c}{x}\right )}{2}+\frac {i \operatorname {dilog}\left (1-\frac {i c}{x}\right )}{2}\right )\) \(87\)
derivativedivides \(-a \ln \left (\frac {c}{x}\right )-b \left (\ln \left (\frac {c}{x}\right ) \arctan \left (\frac {c}{x}\right )+\frac {i \ln \left (\frac {c}{x}\right ) \ln \left (1+\frac {i c}{x}\right )}{2}-\frac {i \ln \left (\frac {c}{x}\right ) \ln \left (1-\frac {i c}{x}\right )}{2}+\frac {i \operatorname {dilog}\left (1+\frac {i c}{x}\right )}{2}-\frac {i \operatorname {dilog}\left (1-\frac {i c}{x}\right )}{2}\right )\) \(92\)
default \(-a \ln \left (\frac {c}{x}\right )-b \left (\ln \left (\frac {c}{x}\right ) \arctan \left (\frac {c}{x}\right )+\frac {i \ln \left (\frac {c}{x}\right ) \ln \left (1+\frac {i c}{x}\right )}{2}-\frac {i \ln \left (\frac {c}{x}\right ) \ln \left (1-\frac {i c}{x}\right )}{2}+\frac {i \operatorname {dilog}\left (1+\frac {i c}{x}\right )}{2}-\frac {i \operatorname {dilog}\left (1-\frac {i c}{x}\right )}{2}\right )\) \(92\)
risch \(\text {Expression too large to display}\) \(669\)

[In]

int((a+b*arctan(c/x))/x,x,method=_RETURNVERBOSE)

[Out]

a*ln(x)+b*(-ln(c/x)*arctan(c/x)-1/2*I*ln(c/x)*ln(1+I*c/x)+1/2*I*ln(c/x)*ln(1-I*c/x)-1/2*I*dilog(1+I*c/x)+1/2*I
*dilog(1-I*c/x))

Fricas [F]

\[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=\int { \frac {b \arctan \left (\frac {c}{x}\right ) + a}{x} \,d x } \]

[In]

integrate((a+b*arctan(c/x))/x,x, algorithm="fricas")

[Out]

integral((b*arctan(c/x) + a)/x, x)

Sympy [F]

\[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=\int \frac {a + b \operatorname {atan}{\left (\frac {c}{x} \right )}}{x}\, dx \]

[In]

integrate((a+b*atan(c/x))/x,x)

[Out]

Integral((a + b*atan(c/x))/x, x)

Maxima [F]

\[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=\int { \frac {b \arctan \left (\frac {c}{x}\right ) + a}{x} \,d x } \]

[In]

integrate((a+b*arctan(c/x))/x,x, algorithm="maxima")

[Out]

b*integrate(arctan2(c, x)/x, x) + a*log(x)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 72 vs. \(2 (25) = 50\).

Time = 0.31 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.85 \[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=-\frac {{\left (2 \, b c^{4} \arctan \left (\frac {c}{x}\right ) - \frac {i \, b c^{6} \log \left (\frac {i \, c}{x} + 1\right )}{x^{2}} + \frac {i \, b c^{6} \log \left (-\frac {i \, c}{x} + 1\right )}{x^{2}} + 2 \, a c^{4} + \frac {2 \, b c^{5}}{x}\right )} x^{2}}{4 \, c^{5}} \]

[In]

integrate((a+b*arctan(c/x))/x,x, algorithm="giac")

[Out]

-1/4*(2*b*c^4*arctan(c/x) - I*b*c^6*log(I*c/x + 1)/x^2 + I*b*c^6*log(-I*c/x + 1)/x^2 + 2*a*c^4 + 2*b*c^5/x)*x^
2/c^5

Mupad [B] (verification not implemented)

Time = 0.37 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.82 \[ \int \frac {a+b \arctan \left (\frac {c}{x}\right )}{x} \, dx=a\,\ln \left (x\right )+\frac {b\,\left ({\mathrm {Li}}_{\mathrm {2}}\left (1-\frac {c\,1{}\mathrm {i}}{x}\right )-{\mathrm {Li}}_{\mathrm {2}}\left (1+\frac {c\,1{}\mathrm {i}}{x}\right )\right )\,1{}\mathrm {i}}{2} \]

[In]

int((a + b*atan(c/x))/x,x)

[Out]

(b*(dilog(1 - (c*1i)/x) - dilog((c*1i)/x + 1))*1i)/2 + a*log(x)